1. Field of the Invention
The invention relates in general to an inquiring apparatus and method thereof, and more particularly to an inquiring apparatus, which can assist the central processor unit (CPU) to reduce its processing time and power consumption, and method thereof.
2. Description of the Related Art
A CPU is a high power-consuming element in electronic products. Even when the CPU is in a standby state, such as waiting for peripheral devices to be ready, it consumes power as operating according to the clock signals.
As the CPU is in the standby state, there are two methods that the CPU can detect the current state of the peripheral device. One is called an interrupting method, in which the peripheral device automatically output an interrupting signal to the CPU. Before the peripheral device awakens the CPU, no clock is output to the CPU, so some power consumption is reduced. As the peripheral device detects an input event, such as the user operates the keyboard, the peripheral device will output an interrupting signal to wake up the CPU to perform the corresponding programs.
Each interrupting signal is input to a different pin of the CPU. Since the number of the CPU pins is limited, the CPU cannot provide enough pins for a variety of peripheral devices.
The other one is a repeatedly polling method, in which the CPU itself inquires the peripheral device repeatedly to determine if the peripheral device comes to an expected state.
Referring to FIG. 1, a flow chart of the conventional repeatedly polling method is shown. First, the CPU reads the current state of the peripheral device in the step 110. Afterwards, the CPU determines if the current state of the peripheral device agrees with the expected state in the step 120. If not, it needs to wait for a period of time in the step 130, such as to execute the command NOP (No Operation), and then to go back to the step 110. If it does, the method is ended.
However, as described in the repeatedly polling method, even in the standby state, the CPU needs to work and the clock is required to be continuously outputted to the CPU. The CPU needs to inquire the peripheral device repeatedly until the peripheral device comes to the expected state. Therefore, such inquiring method will not only waste the CPU's processing time but also be power consuming.